export function setRootFontSize(type = localStorage.getItem('type') || "height") {
  const html = document.documentElement;
  const designWidth = 1920
  const designHeight = 1080
  const designFontSize = 16

  let value = ''

  switch (type) {
    case 'height':
      value = html.clientHeight / designHeight * designFontSize
      break
    case 'width':
      value = html.clientWidth / designWidth * designFontSize
      break
  }

  console.log(`以 ${type} 设置root font-size：`, value + 'px')
  html.style.fontSize = value + 'px'
  return value
}
